-
Notifications
You must be signed in to change notification settings - Fork 122
fix: Remove duplicate Go module cache causing tar conflicts #13942
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The CI workflow was using both setup-go's built-in caching (cache: true) and explicit actions/cache@v4, causing duplicate cache restoration to the same paths. This resulted in tar errors "Cannot open: File exists" during the second cache extraction. Fixed by removing all redundant "Cache Go modules (explicit fallback)" actions, as setup-go@v6 with cache: true already handles Go module caching efficiently. Fixes Integration: Workflow Cache test failures. Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes a CI workflow failure caused by duplicate Go module cache restoration. The workflow was attempting to restore the same cache paths twice - once through setup-go@v6's built-in caching and again through explicit actions/cache@v4 steps, resulting in tar extraction conflicts.
Changes:
- Removed 11 redundant "Cache Go modules (explicit fallback)" blocks that were duplicating the caching already provided by
setup-go@v6 - Retained
setup-go@v6withcache: trueas the single source of Go module caching
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The function was referenced in runtime_import_checkout_test.go but was never implemented. This caused build failures in the CI workflow. The function checks if markdown content contains runtime-import macros with local file paths (starting with . or ..) and excludes URLs (http/https). This resolves the compilation error: pkg/workflow/runtime_import_checkout_test.go:95:14: undefined: containsRuntimeImports All integration tests now pass. Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Fixed in 4218fbf. The test was referencing |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Moved the containsRuntimeImports helper function from runtime_detection.go to runtime_import_checkout_test.go since it's only used in integration tests. This resolves the unused function linter warning while keeping the function available for the tests that need it. Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Fix GitHub Actions Workflow Cache Failure
Root Cause Analysis:
actions/setup-go@v6(withcache: true) AND a separateactions/cache@v4action restore to the same paths (~/go/pkg/mod)Fix Implemented:
Technical Details:
setup-go@v6withcache: trueautomatically caches~/go/pkg/modand~/.cache/go-buildactions/cachefor the same paths causes a conflictAdditional Fix:
containsRuntimeImports()function for integration testsVerification:
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.